package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${entity}Service;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* @author ${author}
* @since ${date}
*/
//@Slf4j
@Service
//@RequiredArgsConstructor
//@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class ${entity}ServiceImpl implements ${entity}Service {

    @Autowired
    private ${entity}Mapper ${entity?uncap_first}Mapper;

    @Override
    public void add${entity}(${entity} ${entity?uncap_first}) {
            ${entity?uncap_first}Mapper.insert(${entity?uncap_first});
    }

    @Override
    public void del${entity}(String id) {
            ${entity?uncap_first}Mapper.deleteById(id);
    }

    @Override
    public void upd${entity}(${entity} ${entity?uncap_first}) {
            ${entity?uncap_first}Mapper.updateById(${entity?uncap_first});
    }

    @Override
    public ${entity} get${entity}ById(String id) {
        return  ${entity?uncap_first}Mapper.selectById(id);
    }

    @Override
    public IPage<${entity}> get${entity}ByPage(Page page, ${entity}  ${entity?uncap_first}) {
        LambdaQueryWrapper<${entity}> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        IPage<${entity}> ${entity?uncap_first}IPage = ${entity?uncap_first}Mapper.selectPage(page, lambdaQueryWrapper);
        return ${entity?uncap_first}IPage;
    }





}